package com.example.mangroves.entity;

import java.util.List;

public class EddyCovarianceData {
    private Head head;
    private List<DataEntry> data;

    public EddyCovarianceData() {
    }

    public EddyCovarianceData(Head head, List<DataEntry> data) {
        this.head = head;
        this.data = data;
    }

    /**
     * 获取
     * @return head
     */
    public Head getHead() {
        return head;
    }

    /**
     * 设置
     * @param head
     */
    public void setHead(Head head) {
        this.head = head;
    }

    /**
     * 获取
     * @return data
     */
    public List<DataEntry> getData() {
        return data;
    }

    /**
     * 设置
     * @param data
     */
    public void setData(List<DataEntry> data) {
        this.data = data;
    }
    @Override

    public String toString() {
        return "EddyCovarianceData{head = " + head + ", data = " + data + "}";
    }

    // getters and setters

    public static class Head {
        private int transaction;
        private int signature;
        private Environment environment;
        private List<Field> fields;

        public Head() {
        }

        public Head(int transaction, int signature, Environment environment, List<Field> fields) {
            this.transaction = transaction;
            this.signature = signature;
            this.environment = environment;
            this.fields = fields;
        }

        /**
         * 获取
         * @return transaction
         */
        public int getTransaction() {
            return transaction;
        }

        /**
         * 设置
         * @param transaction
         */
        public void setTransaction(int transaction) {
            this.transaction = transaction;
        }

        /**
         * 获取
         * @return signature
         */
        public int getSignature() {
            return signature;
        }

        /**
         * 设置
         * @param signature
         */
        public void setSignature(int signature) {
            this.signature = signature;
        }

        /**
         * 获取
         * @return environment
         */
        public Environment getEnvironment() {
            return environment;
        }

        /**
         * 设置
         * @param environment
         */
        public void setEnvironment(Environment environment) {
            this.environment = environment;
        }

        /**
         * 获取
         * @return fields
         */
        public List<Field> getFields() {
            return fields;
        }

        /**
         * 设置
         * @param fields
         */
        public void setFields(List<Field> fields) {
            this.fields = fields;
        }

        @Override
        public String toString() {
            return "Head{transaction = " + transaction + ", signature = " + signature + ", environment = " + environment + ", fields = " + fields + "}";
        }

        // getters and setters
    }

    public static class Environment {
        private String station_name;
        private String table_name;
        private String model;
        private String serial_no;
        private String os_version;
        private String prog_name;

        public Environment() {
        }

        public Environment(String station_name, String table_name, String model, String serial_no, String os_version, String prog_name) {
            this.station_name = station_name;
            this.table_name = table_name;
            this.model = model;
            this.serial_no = serial_no;
            this.os_version = os_version;
            this.prog_name = prog_name;
        }

        /**
         * 获取
         * @return station_name
         */
        public String getStation_name() {
            return station_name;
        }

        /**
         * 设置
         * @param station_name
         */
        public void setStation_name(String station_name) {
            this.station_name = station_name;
        }

        /**
         * 获取
         * @return table_name
         */
        public String getTable_name() {
            return table_name;
        }

        /**
         * 设置
         * @param table_name
         */
        public void setTable_name(String table_name) {
            this.table_name = table_name;
        }

        /**
         * 获取
         * @return model
         */
        public String getModel() {
            return model;
        }

        /**
         * 设置
         * @param model
         */
        public void setModel(String model) {
            this.model = model;
        }

        /**
         * 获取
         * @return serial_no
         */
        public String getSerial_no() {
            return serial_no;
        }

        /**
         * 设置
         * @param serial_no
         */
        public void setSerial_no(String serial_no) {
            this.serial_no = serial_no;
        }

        /**
         * 获取
         * @return os_version
         */
        public String getOs_version() {
            return os_version;
        }

        /**
         * 设置
         * @param os_version
         */
        public void setOs_version(String os_version) {
            this.os_version = os_version;
        }

        /**
         * 获取
         * @return prog_name
         */
        public String getProg_name() {
            return prog_name;
        }

        /**
         * 设置
         * @param prog_name
         */
        public void setProg_name(String prog_name) {
            this.prog_name = prog_name;
        }

        @Override

        public String toString() {
            return "Environment{station_name = " + station_name + ", table_name = " + table_name + ", model = " + model + ", serial_no = " + serial_no + ", os_version = " + os_version + ", prog_name = " + prog_name + "}";
        }

        // getters and setters
    }

    public static class Field {
        private String name;
        private String type;
        private boolean settable;
//        private String process;
        private String units;

        public Field() {
        }

        public Field(String name, String type, boolean settable, String units) {
            this.name = name;
            this.type = type;
            this.settable = settable;
            this.units = units;
        }

        /**
         * 获取
         * @return name
         */
        public String getName() {
            return name;
        }

        /**
         * 设置
         * @param name
         */
        public void setName(String name) {
            this.name = name;
        }

        /**
         * 获取
         * @return type
         */
        public String getType() {
            return type;
        }

        /**
         * 设置
         * @param type
         */
        public void setType(String type) {
            this.type = type;
        }

        /**
         * 获取
         * @return settable
         */
        public boolean isSettable() {
            return settable;
        }

        /**
         * 设置
         * @param settable
         */
        public void setSettable(boolean settable) {
            this.settable = settable;
        }

        /**
         * 获取
         * @return units
         */
        public String getUnits() {
            return units;
        }

        /**
         * 设置
         * @param units
         */
        public void setUnits(String units) {
            this.units = units;
        }

        @Override
        public String toString() {
            return "Field{name = " + name + ", type = " + type + ", settable = " + settable + ", units = " + units + "}";
        }
    }
    public static class DataEntry {
        private String time;
        private int no;
        private List<Object> vals;  // Mixed types

        public DataEntry() {
        }

        public DataEntry(String time, int no, List<Object> vals) {
            this.time = time;
            this.no = no;
            this.vals = vals;
        }

        /**
         * 获取
         * @return time
         */
        public String getTime() {
            return time;
        }

        /**
         * 设置
         * @param time
         */
        public void setTime(String time) {
            this.time = time;
        }

        /**
         * 获取
         * @return no
         */
        public int getNo() {
            return no;
        }

        /**
         * 设置
         * @param no
         */
        public void setNo(int no) {
            this.no = no;
        }

        /**
         * 获取
         * @return vals
         */
        public List<Object> getVals() {
            return vals;
        }

        /**
         * 设置
         * @param vals
         */
        public void setVals(List<Object> vals) {
            this.vals = vals;
        }
        @Override

        public String toString() {
            return "DataEntry{time = " + time + ", no = " + no + ", vals = " + vals + "}";
        }

        // getters and setters
    }
}
